<template>
  <eTable :optionData="evalResult.optionData" :tableData="evalResult.rows" :tableCol="evalResult.cols">
    <template v-slot:relScene="{ data }">
      <span v-if="!(data.row.relScene && data.row.relScene.length > 0)">
        <el-tag :type="data.row.status == '-1' ? 'info' : ''">通用场景</el-tag>
      </span>
      <span v-else>
        <el-tag
          v-for="(item, index) in data.row.relScene"
          :type="data.row.status == '-1' ? 'info' : ''"
          :key="index"
          style="margin:4px"
        >
          {{ item }}
        </el-tag>
      </span>
    </template>
  </eTable>
</template>
<script>
//审计结果

import { reportItemsApi } from "api/evaluateApi";
import eTable from "components/table/comTable";

export default {
  components: {
    eTable,
  },
  data() {
    return {
      evalResult: {
        cols: [
          { label: "指标名称", prop: "name", align: "left" },
          { label: "指标要求", prop: "reportItemContent", align: "left", width: 300 },
          {
            label: "关联场景",
            prop: "relScene",
            type: "slot",
            align: "left",
          },

          {
            label: "现状描述",
            prop: "remark",
            width: 300,
          },
          {
            label: "审计结果",
            prop: "status",
            width: 200,
            formatter: (row, column, cellValue, index) => {
              return this.utils.getDicLabel("status", cellValue);
            },
          },
        ],
        rows: [],
      },
    };
  },
  methods: {},
  async mounted() {
    let { data } = await reportItemsApi({ assetId: this.$route.query.id });
    this.evalResult.rows = data;
  },
};
</script>
